<?PHP
  $template = new Template();
  $template->load("menu_new");
  $template->show_if("NOTSUCCEEDED",!$_POST['name']);
  $template->assign_var("URL","/admin/index.php?page=menue-new");
  if($_POST['name']){
    $template->show_if("SUCCEEDED");
    $id = Menu::create($GLOBALS['db']->EscapeString($_POST['name']));
    if($id){
      $template->assign_var("EDITURL","/admin/index.php?page=menu-edit&menu=".$id);
    }
    else{
	  $template->load("message");
	  $template->assign_var("MESSAGE",$language->getString("MENU_NOT_CREATED"));
    }
  }
  $template->output();
?>